package edu.calpoly.android.lab1loboda; 

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;

public class SecondClass extends Activity implements OnClickListener
{
	private EditText wNameInput;
	public static final String POST_USERNAME = "USERNAME";
	@Override
	public void onCreate(Bundle savedState)
	{
		super.onCreate(savedState);
		this.setContentView(R.layout.name_getter);
		wNameInput	= (EditText)this.findViewById(R.id.name_input);
		this.findViewById(R.id.submit).setOnClickListener(this);
	}
	
	@Override
	public void onClick(View v)
	{
		Intent intent = new Intent(this, HelloWorld.class);
		intent.putExtra(SecondClass.POST_USERNAME, this.wNameInput.getText().toString());
		this.startActivity(intent);
	}
}
